package com.cmc.cloud.cmclink.doc.controller.admin.si;

import com.cmc.cloud.cmclink.doc.api.document.rep.BlnoFobReqDto;
import com.cmc.cloud.cmclink.doc.api.document.rep.BlnoFobRespDto;
import com.cmc.cloud.cmclink.doc.api.document.rep.BlnoNumericalContainerRespDto;
import com.cmc.cloud.cmclink.doc.constants.UrlConstants;
import com.cmc.cloud.cmclink.doc.service.impl.si.BlnoQueryServiceImpl;
import com.cmes.framework.common.pojo.CommonResult;
import com.cmes.framework.operatelog.core.annotations.OperateLog;
import com.cmes.framework.operatelog.core.enums.OperateTypeEnum;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;


/**
 * 提单主信息前端接口Controller
 *
 * @author codegen
 */
@Tag(name = "管理后台 - 提单主信息")
@RestController
@Validated
@RequestMapping(UrlConstants.APPLICATION_URL + "/blnoQuery")
public class BlnoQueryController {
    @Resource
    private BlnoQueryServiceImpl blnoQueryService;

    @Operation(summary = "FOB参数参数查询")
    @OperateLog(type = OperateTypeEnum.CREATE)
    @PostMapping("/queryFobParam")
    public CommonResult<BlnoFobReqDto> queryFobParam(@Valid @RequestBody BlnoFobReqDto reqVo) {
        return CommonResult.success(blnoQueryService.queryFobParam(reqVo));
    }

    @Operation(summary = "FOB统计信息")
    @OperateLog(type = OperateTypeEnum.CREATE)
    @PostMapping("/queryFobInfo")
    public CommonResult<BlnoFobRespDto> queryFobInfo(@Valid @RequestBody BlnoFobReqDto reqVo) {
        return CommonResult.success(blnoQueryService.queryFobInfo(reqVo));
    }

    @Operation(summary = "集装箱装载清单")
    @OperateLog(type = OperateTypeEnum.CREATE)
    @PostMapping("/queryNumericalContainerListInfo")
    public CommonResult<BlnoNumericalContainerRespDto> queryNumericalContainerListInfo(@Valid @RequestBody BlnoFobReqDto reqVo) {
        return CommonResult.success(blnoQueryService.queryNumericalContainerListInfo(reqVo));
    }
}
